<template>
    <div>
        <span v-for="(item, index) in list" :key="index">
            <span v-if="item.sum === ''">{{ index + 1 }}.未完成</span>
            <span v-else>{{ index + 1 }}.已完成</span>

        </span>
    </div>
</template>

<script>
import Bus from '@/utils/BusEvent';
export default {

    created() {
        console.log('开始监听 list 事件'); // 打印日志
        
        Bus.$on('list', (receiveList) => {
            console.log('接收到的数据:', receiveList);
            this.list = receiveList
            console.log('这里已调用');
        })
        
    },
    data() {
        return {
            list: []
        }
    }

}
</script>

<style scoped>
.right {
    color: green;
}

.error {
    color: red;
}

.undo {
    color: #ccc;
}
</style>